-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement view resizing on keyboard show/hide #1119
Implement view resizing on keyboard show/hide #1119
Conversation
Imho there could be only one config param resize, with values |
I can confirm it solves my issue described there: ionic-team/ionic-framework#16797 (cc @paulstelzer ). I noticed a little issue with keyboard showing up slower than the content area being resized. So it renders a white space during the transition. You can see it in the video attached below: Also, I'm still facing the known offset issue described here: #814 . There is no specific steps to reproduce, it's random :/ Thanks for the PR :) |
While inspecting the ion-content element with my browser and my iPhone, I can see this white space is not part of the I can confirm it by setting a background color to it and it doesn't change this space color. But I figured out it works when setting the background color on either the <html or the <body element. |
Thanks for the PR. |
@mlynch
|
I made a change in config parameters, only one parameter needed "resize" with possible values native, ionic, body or none. By default resizing is enabled and set to native mode. So in order to set keyboard resizing parameter, you need to define it in capacitor.config.json:
|
} | ||
} | ||
// NSLog(@"CAPIonicKeyboard: resize mode %d", self.keyboardResizes); | ||
|
||
if (self.keyboardResize == ResizeNative) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think It should be keyboardResizes instead of keyboardResize. It throws an error that keyboardResize is not defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. The "s" was lost, when I changed config param name. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
I've tested it and works fine.
Merging, thanks!
Any idea to fix the difference of synchronization between the keyboard showing up and the content area as I posted in a reply of this PR (#1119 (comment))? @EricKit also described this behavior: ionic-team/ionic-framework#16797 (comment) On another side, if I focus on an input, the keyboard will show up, but if now I try to scroll the view, the view have its padding scrollable here is the result: Note: using released Ionic 4.0 |
Please, don’t comment on closed issues or merged PRs. If something is not working fine report a new issue, it’s very hard to keep track of problems if they are “hidden”. I saw it this time, but might not see it next time, and even if I saw it I might forget |
Very simple implementation of view resizing when keyboard showing/hidding. The logic is copied from cordova-plugin-ionic-keyboard. There are two config parameters related to resizing:
true
orfalse
. Default value istrue
.native
,ionic
orbody
. Default value isnative
.